<%@ page language="java" import="com.alibaba.fastjson.JSONArray" pageEncoding="UTF-8" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.Util" %>
<%--获取员工信息查询结果--%>
<%

    JSONObject dataJson = new JSONObject();
    RecordSet rs = new RecordSet();
    String gh = Util.null2String(request.getParameter("gh"));
    JSONObject jsonData = new JSONObject();
    String message = "";
    try {
        String mainid = "";
        rs.executeQuery("select id,zp,sfz,hky,cbzm,gzwj,cjz from uf_ygxxcx_jm where gh=?", gh);
        if (rs.next()) {
            mainid = Util.null2String(rs.getString("id"));
            dataJson.put("zp", Util.null2String(rs.getString("zp")));
            dataJson.put("sfz", Util.null2String(rs.getString("sfz")));
            dataJson.put("hky", Util.null2String(rs.getString("hky")));
            dataJson.put("cbzm", Util.null2String(rs.getString("cbzm")));
            dataJson.put("gzwj", Util.null2String(rs.getString("gzwj")));
            dataJson.put("cjz", Util.null2String(rs.getString("cjz")));

        }
        JSONArray dataList3 = new JSONArray();
        JSONArray dataList5 = new JSONArray();
        JSONArray dataList7 = new JSONArray();
        JSONArray dataList8 = new JSONArray();
        JSONArray dataList9 = new JSONArray();
        if (!"".equals(mainid)) {
            rs.executeQuery("select rownum,xwxlzs from uf_ygxxcx_jm_dt3 where mainid=?", mainid);
            while (rs.next()) {
                JSONObject dataJson3 = new JSONObject();
                dataJson3.put("rownum", Util.null2String(rs.getString("rownum")));
                dataJson3.put("xwxlzs", Util.null2String(rs.getString("xwxlzs")));
                dataList3.add(dataJson3);
            }
            dataJson.put("dataList3",dataList3);
            rs.executeQuery("select rownum,fj from uf_ygxxcx_jm_dt5 where mainid=?", mainid);
            while (rs.next()) {
                JSONObject dataJson5 = new JSONObject();
                dataJson5.put("rownum", Util.null2String(rs.getString("rownum")));
                dataJson5.put("fj", Util.null2String(rs.getString("fj")));
                dataList5.add(dataJson5);
            }
            dataJson.put("dataList5",dataList5);
            rs.executeQuery("select rownum,fj from uf_ygxxcx_jm_dt7 where mainid=?", mainid);
            while (rs.next()) {
                JSONObject dataJson7 = new JSONObject();
                dataJson7.put("rownum", Util.null2String(rs.getString("rownum")));
                dataJson7.put("fj", Util.null2String(rs.getString("fj")));
                dataList7.add(dataJson7);
            }
            dataJson.put("dataList7",dataList7);
            rs.executeQuery("select rownum,fj from uf_ygxxcx_jm_dt8 where mainid=?", mainid);
            while (rs.next()) {
                JSONObject dataJson8 = new JSONObject();
                dataJson8.put("rownum", Util.null2String(rs.getString("rownum")));
                dataJson8.put("fj", Util.null2String(rs.getString("fj")));
                dataList8.add(dataJson8);
            }
            dataJson.put("dataList8",dataList8);
            rs.executeQuery("select rownum,fj from uf_ygxxcx_jm_dt9 where mainid=?", mainid);
            while (rs.next()) {
                JSONObject dataJson9 = new JSONObject();
                dataJson9.put("rownum", Util.null2String(rs.getString("rownum")));
                dataJson9.put("fj", Util.null2String(rs.getString("fj")));
                dataList9.add(dataJson9);
            }
            dataJson.put("dataList9",dataList9);
        }
    } catch (Exception e) {
        e.printStackTrace();
        message = "程序内部异常";
    }
    jsonData.put("data", dataJson);
    jsonData.put("message", message);
    out.print(jsonData.toJSONString());

%>
<%!


%>



